Ternary 三元運算子


Posted by Rich on 2021-04-22

console.log(10 > 5 ? 'bigger' : 'smaller')
output:bigger

condition ? true : false
條件 ? true就執行 : false就執行


#note







Related Posts

Vue 3 使用 axios 套件取得遠端資料

Vue 3 使用 axios 套件取得遠端資料

W14 直播檢討

W14 直播檢討

修改 Sublime Tab 預設為空兩格

修改 Sublime Tab 預設為空兩格


Comments